/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Alvaro
 */
@Entity
@Table(name = "public_relations_candidate")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PublicRelationsCandidate.findAll", query = "SELECT p FROM PublicRelationsCandidate p"),
    @NamedQuery(name = "PublicRelationsCandidate.findByIdPublicRelacionshipsCandidate", query = "SELECT p FROM PublicRelationsCandidate p WHERE p.idPublicRelacionshipsCandidate = :idPublicRelacionshipsCandidate"),
    @NamedQuery(name = "PublicRelationsCandidate.findByIdPublicRelacions", query = "SELECT p FROM PublicRelationsCandidate p WHERE p.candidate.user.relatedUser.idUser = :publicRelationsIdUser"),
    @NamedQuery(name = "PublicRelationsCandidate.findByPayDate", query = "SELECT p FROM PublicRelationsCandidate p WHERE p.payDate = :payDate"),
    @NamedQuery(name = "PublicRelationsCandidate.findByAmount", query = "SELECT p FROM PublicRelationsCandidate p WHERE p.amount = :amount")})
public class PublicRelationsCandidate implements Serializable {
    @JoinColumn(name = "CANDIDATE", referencedColumnName = "ID_CANDIDATE")
    @OneToOne(optional = false)
    private Candidate candidate;
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_PUBLIC_RELACIONSHIPS_CANDIDATE")
    private Integer idPublicRelacionshipsCandidate;
    @Column(name = "PAY_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date payDate;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "AMOUNT")
    private BigDecimal amount;

    public PublicRelationsCandidate() {
    }

    public PublicRelationsCandidate(Integer idPublicRelacionshipsCandidate) {
        this.idPublicRelacionshipsCandidate = idPublicRelacionshipsCandidate;
    }

    public Integer getIdPublicRelacionshipsCandidate() {
        return idPublicRelacionshipsCandidate;
    }

    public void setIdPublicRelacionshipsCandidate(Integer idPublicRelacionshipsCandidate) {
        this.idPublicRelacionshipsCandidate = idPublicRelacionshipsCandidate;
    }

    public Date getPayDate() {
        return payDate;
    }

    public void setPayDate(Date payDate) {
        this.payDate = payDate;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPublicRelacionshipsCandidate != null ? idPublicRelacionshipsCandidate.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PublicRelationsCandidate)) {
            return false;
        }
        PublicRelationsCandidate other = (PublicRelationsCandidate) object;
        if ((this.idPublicRelacionshipsCandidate == null && other.idPublicRelacionshipsCandidate != null) || (this.idPublicRelacionshipsCandidate != null && !this.idPublicRelacionshipsCandidate.equals(other.idPublicRelacionshipsCandidate))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.PublicRelationsCandidate[ idPublicRelacionshipsCandidate=" + idPublicRelacionshipsCandidate + " ]";
    }

    public Candidate getCandidate() {
        return candidate;
    }

    public void setCandidate(Candidate candidate) {
        this.candidate = candidate;
    }
    
}
